package cn.edu.nju.software.zp13.client.assignment9UsingJAXB.assignment4Refactoring.scoreList2.core;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;

import cn.edu.nju.software.zp13.client.assignment9UsingJAXB.assignment4Refactoring.bean.CourseScoreList;

public class CourseScoreListDeserializer {
	public static CourseScoreList run(String filePath) {

		try {
			JAXBContext jaxbContext = JAXBContext.newInstance(CourseScoreList.class);
			Unmarshaller u = jaxbContext.createUnmarshaller();
			CourseScoreList list = (CourseScoreList) u.unmarshal(new File(filePath));
			return list;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
